//import com.fasterxml.jackson.databind.ObjectMapper;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.List;
//
//
//
///**
// * @Author YuanYuan
// * @Date 2022/11/20
// * @Time 16:57
// */
//@WebServlet("/Message")
//public class MessageSevlet<ObjectMapper> extends HttpServlet {
//    List<Message> messageList = new ArrayList<>();
//    //json提供的
//    ObjectMapper objectMapper = new ObjectMapper();
//    //从服务器获取数据
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        List<Message> list = null;
//        resp.setContentType("application/json;charset=utf8");
//        resp.getWriter().write(objectMapper.writeValueAsString(list));
//    }
//
//    //向服务器提交数据(请求)
//    @Override
//    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        Message message = objectMapper.readValue(req.getInputStream(),Message.class);
//        //resp.setContentType("application/json;charset=utf8");
//        messageList.add(message);
//        resp.setStatus(200);
//        System.out.println("提交数据成功: from=" + message.getFrom()
//                + ", to=" + message.getTo() + ", message=" + message.getMessage());
//    }
//}

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet("/Message")
public class MessageSevlet extends HttpServlet {
    List<Message> messageList = new ArrayList<>();
    Object

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Message message =
    }
}
